
package com.jims.master.modules.doctor.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.jims.master.common.persistence.TreeEntity;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 门诊处方明细Entity
 * @author CTQ
 * @version 2017-03-13
 */
public class PrescriptionItem extends TreeEntity<PrescriptionItem> {
	
	private static final long serialVersionUID = 1L;
	private String applyId;		// 处方申请Id
	private String priceId;//价表ID
	private String drugName;		// 药品名称
	private String drugCode;		// 药品名称编码
	private String unit;		// 单位
	private String packageUnit;		// 包装单位
	private String spec;		// 规格
	private String packageSpec;		// 包装规格
	private String firmId;		// 厂家标识
	private String firmName;		// 商家名称
	private Double singleDosage;		// 单次用量
	private String singleUnit;		// 用量单位
	private String channel;		// 途径
	private String frequency;		// 频次
	private Double num;		// 药品数量
	private Double price;		// 单价
	private Double sumPrice;		// 总价
	private String isSkin;		// 是否皮试
	private String skinResult;		// 皮试结果
	private Integer repetition;//剂数
	private Integer abidance;//用药天数
	// 扩展
	private String prescStatus;
	private List<PrescriptionItem> list;
	private String tempalteId;

    private String flag;
    private String ordersId;
    private String clinicId;


	public List<PrescriptionItem> getList() {
		return list;
	}

	public void setList(List<PrescriptionItem> list) {
		this.list = list;
	}

	public String getTempalteId() {
		return tempalteId;
	}

	public void setTempalteId(String tempalteId) {
		this.tempalteId = tempalteId;
	}

	public String getPrescStatus() {
		return prescStatus;
	}

	public void setPrescStatus(String prescStatus) {
		this.prescStatus = prescStatus;
	}

	private List<PrescriptionItem> itemList;
	
	public PrescriptionItem() {
		super();
	}

	public PrescriptionItem(String id){
		super(id);
	}

    @JsonBackReference
    public PrescriptionItem getParent() {
        return parent;
    }

    public void setParent(PrescriptionItem parent) {
        this.parent = parent;
    }


    @Length(min=1, max=64, message="处方申请序号长度必须介于 1 和 64 之间")
	public String getApplyId() {
		return applyId;
	}

	public void setApplyId(String applyId) {
		this.applyId = applyId;
	}
	
	@Length(min=1, max=200, message="药品名称长度必须介于 1 和 200 之间")
	public String getDrugName() {
		return drugName;
	}

	public void setDrugName(String drugName) {
		this.drugName = drugName;
	}
	
	@Length(min=1, max=100, message="药品名称编码长度必须介于 1 和 100 之间")
	public String getDrugCode() {
		return drugCode;
	}

	public void setDrugCode(String drugCode) {
		this.drugCode = drugCode;
	}
	
	@Length(min=1, max=20, message="单位长度必须介于 1 和 20 之间")
	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}
	
	@Length(min=1, max=20, message="包装单位长度必须介于 1 和 20 之间")
	public String getPackageUnit() {
		return packageUnit;
	}

	public void setPackageUnit(String packageUnit) {
		this.packageUnit = packageUnit;
	}
	
	@Length(min=1, max=20, message="规格长度必须介于 1 和 20 之间")
	public String getSpec() {
		return spec;
	}

	public void setSpec(String spec) {
		this.spec = spec;
	}
	
	@Length(min=1, max=20, message="包装规格长度必须介于 1 和 20 之间")
	public String getPackageSpec() {
		return packageSpec;
	}

	public void setPackageSpec(String packageSpec) {
		this.packageSpec = packageSpec;
	}
	
	@Length(min=1, max=64, message="厂家标识长度必须介于 1 和 64 之间")
	public String getFirmId() {
		return firmId;
	}

	public void setFirmId(String firmId) {
		this.firmId = firmId;
	}
	
	@Length(min=1, max=200, message="商家名称长度必须介于 1 和 200 之间")
	public String getFirmName() {
		return firmName;
	}

	public void setFirmName(String firmName) {
		this.firmName = firmName;
	}
	
	@NotNull(message="单次用量不能为空")
	public Double getSingleDosage() {
		return singleDosage;
	}

	public void setSingleDosage(Double singleDosage) {
		this.singleDosage = singleDosage;
	}
	
	@Length(min=0, max=20, message="用量单位长度必须介于 0 和 20 之间")
	public String getSingleUnit() {
		return singleUnit;
	}

	public void setSingleUnit(String singleUnit) {
		this.singleUnit = singleUnit;
	}
	
	@Length(min=1, max=64, message="途径长度必须介于 1 和 64 之间")
	public String getChannel() {
		return channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}
	
	@Length(min=1, max=20, message="频次长度必须介于 1 和 20 之间")
	public String getFrequency() {
		return frequency;
	}

	public void setFrequency(String frequency) {
		this.frequency = frequency;
	}
	
	@Length(min=0, max=11, message="药品数量长度必须介于 0 和 11 之间")
	public Double getNum() {
		return num;
	}

	public void setNum(Double num) {
		this.num = num;
	}
	
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	
	public Double getSumPrice() {
		return sumPrice;
	}

	public void setSumPrice(Double sumPrice) {
		this.sumPrice = sumPrice;
	}
	
	@Length(min=0, max=1, message="是否皮试长度必须介于 0 和 1 之间")
	public String getIsSkin() {
		return isSkin;
	}

	public void setIsSkin(String isSkin) {
		this.isSkin = isSkin;
	}
	
	@Length(min=0, max=200, message="皮试结果长度必须介于 0 和 200 之间")
	public String getSkinResult() {
		return skinResult;
	}

	public void setSkinResult(String skinResult) {
		this.skinResult = skinResult;
	}

	public Integer getRepetition() {
		return repetition;
	}

	public void setRepetition(Integer repetition) {
		this.repetition = repetition;
	}

	public Integer getAbidance() {
		return abidance;
	}

	public void setAbidance(Integer abidance) {
		this.abidance = abidance;
	}

	public List<PrescriptionItem> getItemList() {
		return itemList;
	}

	public void setItemList(List<PrescriptionItem> itemList) {
		this.itemList = itemList;
	}

	public String getPriceId() {
		return priceId;
	}

	public void setPriceId(String priceId) {
		this.priceId = priceId;
	}

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getOrdersId() {
        return ordersId;
    }

    public void setOrdersId(String ordersId) {
        this.ordersId = ordersId;
    }

    public String getClinicId() {
        return clinicId;
    }

    public void setClinicId(String clinicId) {
        this.clinicId = clinicId;
    }
}